<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>帖子列表</title>
    <link rel="stylesheet" type="text/css" href="../../public/home/css/style_1_common.css" />
    <link rel="stylesheet" type="text/css" href="../../public/home/css/style_1_forum_index.css" />
    <link rel="stylesheet" id="css_extstyle" type="text/css" href="../../public/home/css/style.css" />
    <script src="../../public/home/js/common.js" type="text/javascript"></script>
    <script src="../../public/home/js/forum.js" type="text/javascript"></script>
    <script src="../../public/home/js/jquery-3.3.1.js" type="text/javascript"></script>
    <style>
        #list{
            width:950px; border: 1px solid silver;margin: 10px 0 10px 0;
            float:left;
            padding-bottom:20px;
            border-radius:5px;
            background-color:white;
            /*border:1px solid green;*/
        }
        #list #listbt{
            width:950px;
            float:left;
            /*border:1px solid blue;*/
        }
        #list #listbt #bkname{
            width:100px;
            height:50px;
            float:left;
            font-size:15px;
            line-height:50px;
            padding-left:20px;
            margin-left:20px;
            /*border:1px solid red;*/

        }
        #list #listbt #bzname{
            width:100px;
            height:50px;
            float:right;
            color:#636969;
            font-size:15px;
            line-height:50px;
        }
        #list #bkinfo{
            width:920px;
            height:100px;
            line-height:100px;
            margin-top:-20px;
            margin-bottom:-20px;
            float:left;
        }
        #list #bkinfo #bklogo{
            width:60px;
            height:60px;
            float:left;
            margin-top:20px;
            margin-left:21px;
            /*border:1px solid blue;*/
        }
        #list #bkinfo #tjinfo{
            width:320px;
            height:28px;
            margin-top:20px;
            float:left;
        }
        #list #bkinfo #tjinfo ul{
            list-style:none;
            float:left;
            height:30px;
            line-height:30px;
            /*border:1px solid red;*/
        }
        #list #bkinfo #tjinfo ul li{
            float:left;
            margin-left:10px;
            font-size:12px;
            color:#636969;
        }
        #list #bkinfo #tjinfo ul li span{
            color:red;
        }
        #list #bkinfo #bkjianj{
            width:320px;
            height:30px;
            float:left;
            margin-top:50px;
            margin-left:-321px;
        }
        #list #bkinfo #bkjianj{
            /*border:1px solid blue;*/
        }
        #list #bkinfo #bkjianj p{
            font-size:12px;
            height:30px;
            float:left;
            line-height:30px;
            padding-left:10px;
            /*border:1px solid yellow;*/
        }
        #list #page{
            float:left;
            width:950px;
            margin-top:20px;
        }
        #list #page #pagefy{
            float:left;
        }
        #list #page #pagefy ul{
            list-style:none;
            margin-left:18px;
        }
        #list #page #pagefy ul li{
            float:left;
            margin-left:5px;
            padding:4px 0px;
            border:1px solid #636969;
        }
        #list #page #pagefy ul li a{
            padding:5px 10px;
            color:#636969;
        }
        #list #page #pagefy ul li a:hover{
            color:white;
            background-color:#636969;
        }
        #list #page #fatie{
            float:right;
            margin-right:20px;
        }
        #list #page #fatie button{
            width:60px;
            height:30px;
            color:white;
            background-color:#fc0;
            border:1px solid #fc0;
            border-left:2px solid white;
            border-top:2px solid white;
            border-radius:5px;
            font-weight:bold;
            cursor:pointer;
            box-shadow:5px 5px 12px #ccc;
        }
        #list #tiezifl{
            float:left;
            width:950px;
            height:25px;
            line-height:25px;
            margin-top:15px;
            background-color:#F1F2F6;
            border-bottom:2px solid #DCDCDC;
            font-size:15px;
        }
        #list #tiezifl ul{
            list-style:none;
        }
        #list #tiezifl ul li{
            float:left;
            padding:0px 15px;
            margin-left:25px;
        }
        #list #tiezifl ul li:hover{
            background-color:white;
            margin-top:2px;
        }
        #list #tiezifl ul li a{
            color:black;
        }
        #list #tiezifl ul li a:hover{
            color:red;
        }
        #list #tiezifl ul li.gaol{
            background-color:white;
            margin-top:2px;
            padding:0px 15px 0px 15px ;
        }
        #list #tiezifl2{
            width:915px;
            height:30px;
            float:left;
            margin-top:15px;
            padding-left:35px;
            border-bottom:1px solid #ccc;
        }
        #list #tiezifl2 ul{
            list-style:none;
        }
        #list #tiezifl2 ul li{
            float:left;
            margin-left:5px;
            font-size:12px;
        }
        #list #tiezifl2 ul li a{
            color:#fc3947;
        }
        #list #tiezifl2 ul li a:hover{
            color:black;
        }
        #list #biaotou{
            width:930px;
            height:30px;
            line-height:30px;
            float:left;
            margin:0px 10px;
            border-bottom:1px solid #ccc;
        }
        #list #biaotou ul{
            list-style:none;
        }
        #list #biaotou ul li{
            float:left;
            font-size:15px;
            color:#636969;
            margin-left:55px;
        }
        #list #biaotou ul li a{
            color:#636969;
        }
        #list #biaotou ul li a:hover{
            color:blue;
        }
        #list #biaotou ul li.tiezibt{
            width:600px;
            margin-left:20px;
        }
        #list #listks .invitationzt{
            width:910px;
            height:30px;
            line-height:30px;
            float:left;
            margin-left:10px;
            padding-left:20px;
            /*border:1px solid red;*/
            border-bottom:1px dashed #ccc;
        }
        #list #listks .invitationzt a{
            font-size:15px;
            color:black;
        }
        #list #listks .invitationzt a:hover{
            color:blue;
        }
        #list #listks .invitationzt .invitalogo{
            width:30px;
            height:30px;
            float:left;
            /*border:1px solid blue;*/
        }
        #list #listks .invitationzt .invitationbt{
            width:600px;
            height:30px;
            float:left;
            /*border:1px solid blue;*/
        }
        #list #listks .invitationzt .custorzt{
            width:25px;
            height:30px;
            float:left;
        }
        #list #listks .invitationzt .custor{
            width:85px;
            height:30px;
            float:left;
            /*border:1px solid blue;*/
        }
        #list #listks .invitationzt .reply{
            width:85px;
            height:30px;
            float:left;
            /*border:1px solid blue;*/
        }
        #list #listks .invitationzt .last{
            width:78px;
            height:30px;
            float:left;
            /*border:1px solid blue;*/
        }
        #clear{
            clear:both;
        }

    </style>
</head>
<body>
<div id="append_parent"></div><div id="ajaxwaitid"></div>
<div id="toptb" class="cl">
    <div class="wp">
        <div class="z"><a href="javascript:;"  onclick="setHomepage('#');">设为首页</a><a href="#"  onclick="addFavorite(this.href, '思爱婚介');return false;">收藏本站</a></div>
        <div class="y">
            <a id="switchblind" href="javascript:;" onClick="toggleBlind(this)" title="开启辅助访问" class="switchblind">开启辅助访问</a>
        </div>
    </div>
</div>

<div id="qmenu_menu" class="p_pop blk" style="display: none;">
    <div class="ptm pbw hm">
        请 <a href="javascript:;" class="xi2" onclick="lsSubmit()"><strong>登录</strong></a> 后使用快捷导航<br />没有帐号？<a href="member.php?mod=register888" class="xi2 xw1">立即注册</a>
    </div>
    <div id="fjump_menu" class="btda"></div></div><div id="hd">
    <div class="wp">
        <div class="hdc cl"><h2><a href="index.php" title="思爱婚介"><img src="../../public/home/images/logo.png" alt="思爱婚介" border="0" /></a>
            </h2><script src="js/logging.js" type="text/javascript"></script>
            <?php
            require 'config.php';
            @$id = $_COOKIE['id1'];
            @$sql = "select * from userdetail where uid = $id ";
            @$result = mysqli_query($link,$sql);
            @$rows = mysqli_fetch_assoc($result);
            @$photo = $rows['photo'];
            @$fh='x_';
            @$hz=basename($photo);
            @$logo1 = './images/'.$hz;
            @$logo ='../upuser/images/'.$fh.$hz;
            @$sql1 = "select * from jifen where uid = $id";
            @$result1 = mysqli_query($link,$sql1);
            @$rows1 = mysqli_fetch_assoc($result1);
            @$jien = $rows1['integral'];
            @$group = $rows1['group'];
            if ($jien <= 100){
                $group = '黑铁';
            }elseif ($jien <= 200 && $jien>100){
                $group = '白银';
            }elseif ($group <= 300 && $jien>200){
                $group = '黄金';
            }elseif ($group <= 400 && $jien>300){
                $group = '白金';
            }elseif ($group <= 500 && $jien>400){
                $group = '钻石';
            }elseif ($group>500){
                $group = '王者';
            }
            ?>
            <?php
            @$auth = $_COOKIE['uname1'];
            @$auth1 = $_COOKIE['auth1'];
            if(empty($auth)){
                echo '<form method="post" autocomplete="off" id="lsform" action="contro.php?a=login">
                <div class="fastlg cl">
                    <span id="return_ls" style="display:none"></span>
                    <div class="y pns">
                        <table cellspacing="0" cellpadding="0">
                            <tr>

                                <td>用户名:<input type="text" name="uname" id="ls_username" autocomplete="off" class="px vm" tabindex="901" /></td>
                                <td class="fastlg_l"><label for="ls_cookietime"><input type="checkbox" name="ji" value="1"/>记住密码</label></td>
                                <td>&nbsp;<a href="./mima/mima.php">找回密码</a></td>
                            </tr>
                            <tr>
                                <td>密　码:<input type="password" name="pwd" id="ls_username" autocomplete="off" class="px vm" tabindex="901" /></td>
                                <td class="fastlg_l"><input type="submit" class="pn vm" tabindex="904" value="登录" style="width: 75px;"></input></td>
                                <td>&nbsp;<a href="../register/register.php" class="xi2 xw1">立即注册</a></td>
                            </tr>
                        </table>
                        <input type="hidden" name="quickforward" value="yes" />
                        <input type="hidden" name="handlekey" value="ls" />
                    </div>
                </div>
            </form>';
            }else{
                if ($auth1 =='普通用户'){
                    echo "
                <div id=\"um\" style='float: right;'>
                <p style='float: left'>
                <img style='height: 50px;' src=\"{$logo}\"></p>
                <div style='float: right; margin-left: 10px;'>
                <strong><a href=\"update.php\" >{$auth}</a></strong>
                <span class=\"pipe\">|</span><a href=\"./update.php\">完善资料</a>
                <span class=\"pipe\">|</span><a href=\"\">签到</a>
                <span class=\"pipe\">|</span><a href='../vip.php'>
                    充值会员
                </a>
                <script language=\"javascript\">delayShow($('myprompt'), function() {showMenu({'ctrlid':'myprompt','duration':3})});</script><span class=\"pipe\">|</span>
               
                <span class=\"pipe\">|</span><a href=\"contro.php?a=exit\">退出</a>
                 <p>
<a href=\"\" id=\"extcreditmenu\"  class=\"showmenu\" initialized=\"true\">积分:  $jien</a>
<span class=\"pipe\">|</span><a href=\"\" id=\"g_upmine\" class=\"showmenu\">用户组:  $group</a>
</p>
                </div>
                
                </div>";
                }else{
                    echo "
                <div id=\"um\" style='float: right;'>
                <p style='float: left'>
                <img style='height: 50px;' src=\"{$logo}\"></p>
                <div style='float: right; margin-left: 10px;'>
                <strong><a href=\"update.php\"  style='color:red;'>{$auth}</a></strong>
                <span class=\"pipe\">|</span><a href=\"./update.php\">完善资料</a>
                <span class=\"pipe\">|</span><a href=\"\">签到</a>
                <span class=\"pipe\">|</span><a href='../vip.php'>
                    充值会员
                </a>
                <script language=\"javascript\">delayShow($('myprompt'), function() {showMenu({'ctrlid':'myprompt','duration':3})});</script><span class=\"pipe\">|</span>
             
                <span class=\"pipe\">|</span><a href=\"contro.php?a=exit\">退出</a>
                 <p>
<a href=\"\" id=\"extcreditmenu\"  class=\"showmenu\" initialized=\"true\">积分:  $jien</a>
<span class=\"pipe\">|</span><a href=\"\" id=\"g_upmine\" class=\"showmenu\">用户组:  $group</a>
</p>
                </div>
                
                </div>";
                }

            }
            ?>
        </div>

        <div id="nv">
            <a href="javascript:;" id="qmenu" onMouseOver="delayShow(this, function () {showMenu({'ctrlid':'qmenu','pos':'34!','ctrlclass':'a','duration':2});showForummenu();})">快捷导航</a>
            <ul><li class="a" id="mn_forum" ><a href="../index.php" hidefocus="true" title="BBS" >论坛首页<span>BBS</span></a>
                <li id="mn_F478" ><a href="#" hidefocus="true"  >两性课堂</a></li>
                <li id="mn_F477" ><a href="#" hidefocus="true"  >网上征婚指南</a></li>
                <li id="mn_F476" ><a href="#" hidefocus="true"  >成功案例</a></li>
                <li id="mn_F482" ><a href="#" hidefocus="true"  >专家咨询</a></li></ul>
        </div>
        <div id="mu" class="cl">
        </div><div id="scbar" class="cl">
            <form id="scbar_form" method="post" action="./sou.php?a=sea">
                <input type="hidden" name="id" id="scbar_mod" value="<?php echo $id;?>"/>
                <table cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="scbar_icon_td"></td>
                        <td class="scbar_txt_td"><input type="text" name="sear" id="scbar_txt" placeholder="请输入搜索内容" /></td>
                        <td style="padding-left: 10px"><select name="select">
                                <option value="1">帖子</option>
                                <option value="3">用户</option>
                                <option value="4">板块</option>
                            </select></td>
                        <td ><input style="
         background: #5e5e5e; width: 50px;
            height: 30px; margin-bottom: 8px; margin-left: 10px;
        " type="submit" name="" id="scbar_btn" class="pn pnc" value="搜索" ></td>
                        <td class="scbar_hot_td">
                        </td>
                    </tr>
                </table>
            </form>
        </div>
        <div id="list">
                <?php
                if (!empty($_GET['sear'])){
                $sear = $_GET['sear'];
                $sql = "select * from post,type,user where post.tid=type.id and post.uid=user.id  and post.title like '%$sear%'";
                $result = mysqli_query($link,$sql);
                $num_All = mysqli_num_rows($result);
                //分页几条；
                $page = 4;
                //分几页,总页数；
                $page_All = ceil($num_All / $page);
                //判断p是否有值；
                if (empty($_GET['p'])) {
                    $p = 1;
                } else {
                    $p = $_GET['p'];
                }
                $page_num = ($p - 1) * $page;

                ?>

                <div id="tiezifl">
                    <ul>
                        <li class="gaol"><a href="#">全部</a></li>
                        <li><a href="#">精华</a></li>
                        <li><a href="#">投票</a></li>
                        <li><a href="#">悬赏</a></li>
                        <li><a href="#">商品</a></li>
                    </ul>
                </div>
                <div id="tiezifl2">
                    <ul>
                        <li><a href="#">全部</a> |</li>
                        <li><a href="#">已解决</a> |</li>
                        <li><a href="#">我要提问</a> |</li>
                        <li><a href="#">PHP</a> |</li>
                        <li><a href="#">其他</a> |</li>
                        <li><a href="#">经验技巧</a> |</li>
                    </ul>
                </div>
                <div id="biaotou">
                    <ul>
                        <li class="tiezibt">排序:<a href="#">最新发帖</a>|<a href="#">最后回复</a></li>
                        <li><a href="#">作者</a></li>
                        <li><a href="#">回复</a></li>
                        <li><a href="#">最后发表</a></li>
                    </ul>
                </div>
                <div id="listks">
                    <?php
                       @$id1 = $_GET['id'];
                    ?>
                    <?php
                    $sql = "select * ,post.id as postid from post,type,user where post.tid=type.id and post.uid=user.id  and post.title like '%$sear%' limit {$page_num},{$page}";
                    $result = mysqli_query($link,$sql);
                    while($rows = mysqli_fetch_assoc($result)) {
                        $c= $rows['ctime'];
                        $ct = date('Y-m-d',$c);
                        $nei = $rows['content'];
                        $sql6 = "select count(content) as count from reply where pid = {$rows['postid']}";
                        $result6 = mysqli_query($link,$sql6);
                        $rows6 = mysqli_fetch_assoc($result6);
                        $hc = $rows6['count'];
                        $netime = time();
                        $sql2 = "select * from post where ctime = (select max(ctime) from post where title like '%$sear%' )";
                        $result2 = mysqli_query($link,$sql2);
                        $rows2 = mysqli_fetch_assoc($result2);
                        $ctime = $rows2['ctime'];
                        $time = $netime - $ctime;
                        $time1 =floor($time / 60);
                        if ($time1 < 60){
                            $hui = $time1.'分钟前';
                        }elseif ($time1 > 60 && $time1<=1440){
                            $hui = floor($time1/60).'小时前';

                        }elseif ($time1> 1440 && $time1<=43200){

                            $hui = floor($time1/1440).'天前';
                        }elseif($time1 > 43200 && $time1 <=518400){
                            $hui = floor($time1/43200).'月前';
                        }elseif($time1 > 518400){
                            $hui = floor($time1/518400).'年前';
                        }else{

                        }
                        ?>
                        <div class="invitationzt">
                            <div class="invitalogo">
                                <img src="../../public/home/images/tongzhi.png">
                            </div>
                            <?php
                            if ($rows['top']==1 && $rows['elite']==0){
                                ?>
                                <div class="invitationbt">
                                    <a href="../post/post.php?id=<?php echo $id1?>&auto=<?php echo $rows['userName']?>&title=<?php echo $rows['title'] ?>&dudu=<?php echo $rows['postid'];?>&time=<?php echo $ct ?>&count=<?php echo $nei?>"><?php echo $rows['title'] ?><img src="../../public/home/images/ding.jpg" height="20px"> </a>
                                </div>
                            <?php }elseif($rows['elite']==1 && $rows['top']==0){
                                ?>
                                <div class="invitationbt">
                                    <a href="../post/post.php?id=<?php echo $id1?>&auto=<?php echo $rows['userName']?>&title=<?php echo $rows['title'] ?>&dudu=<?php echo $rows['postid'];?>&time=<?php echo $ct ?>&count=<?php echo $nei?>"><?php echo $rows['title'] ?><img src="../../public/home/images/digest_2.gif" height="20px">  </a>
                                </div>
                                <?php
                            }elseif ($rows['elite']==1 && $rows['top']==1 ){?>
                                <div class="invitationbt">
                                    <a href="../post/post.php?id=<?php echo $id1?>&auto=<?php echo $rows['userName']?>&title=<?php echo $rows['title'] ?>&dudu=<?php echo $rows['postid'];?>&time=<?php echo $ct ?>&count=<?php echo $nei?>"><?php echo $rows['title'] ?><img src="../../public/home/images/ding.jpg" height="20px" style="margin-left: 10px"><img src="../../public/home/images/digest_2.gif" height="20px">  </a>
                                </div>
                                <?php
                            }else{?>
                                <div class="invitationbt">
                                    <a href="../post/post.php?id=<?php echo $id1?>&auto=<?php echo $rows['userName']?>&title=<?php echo $rows['title'] ?>dudu=<?php echo $rows['postid'];?>&time=<?php echo $ct ?>&count=<?php echo $nei?>"><?php echo $rows['title'] ?></a>
                                </div>
                            <?php }?>
                            <div class="custorzt">
                                <img src="../../public/home/images/zuanshi.png">
                            </div>
                            <div class="custor">
                                <a href="#"><?php echo $rows['userName']?></a>
                            </div>
                            <div class="reply">
                                <a href="#"><?php echo $hc?></a>
                            </div>
                            <div class="last">
                                <a href="#"><?php echo $hui?></a>
                            </div>
                        </div>

                        <?php
                    }
                    }

                    ?>
                    <?php
                    if (empty($_GET['sear'])){

                        echo "<script>alert('搜索内容为空');window.location.href='../index.php';</script>";
                    }
                    ?>



                <div id="page">
                    <div id="pagefy">
                        &nbsp;
                        <ul>

                            <li><a href="./sea.php?p=1&id=<?php echo @$id1?>&sear=<?php echo @$sear?>">首页</a>&nbsp;</li>
                            <li><a href="./sea.php?p=<?php echo $p<=1?1:($p-1)?>&sear=<?php echo @$sear?>">上一页</a>&nbsp;&nbsp;</li>
                            <li><a href="./sea.php?p=<?php echo $p>=$page_All?$page_All:($p+1)?>&sear=<?php echo @$sear?>">下一页</a>&nbsp;&nbsp;&nbsp;</li>
                            <li><a href="./sea.php?p=<?php echo $page_All;?>&sear=<?php echo @$sear?>">尾页</a>&nbsp;&nbsp;&nbsp;</li>
                        </ul>
                        <div style="text-align: center; line-height:20px">当前<?php echo $p;?>/<?php echo $page_All;?>页 总条数：<?php echo $num_All;?>条</div>
                    </div>
                    <div id="fatie">
                        <a href="#"><button image="./public/fatie.png">发帖</button></a>
                    </div>
                </div>
            </div>   </div></div>
    <div id="ft" class="wp cl" >
        <div id="flk" class="y" style="float: right">
            <p>

                <a href="#" title="QQ"><img src="../../public/home/images/site_qq.jpg" /></a><span class="pipe">|</span>
                <a href="#" >小黑屋</a><span class="pipe">|</span><strong><a href="#">思爱婚介</a></strong>
                ( <a href="#">辽ICP备17005792号</a> | <a  href="#">
                    <img src="../../public/home/images/batb.png"/>辽公网安备 21070302000224号</a> )<script>
                    var _hmt = _hmt || [];
                    (function() {
                        var hm = document.createElement("script");
                        hm.src = "https://hm.baidu.com/hm.js?9e8c3f499ab5f67dea0fd34fd9d213e6";
                        var s = document.getElementsByTagName("script")[0];
                        s.parentNode.insertBefore(hm, s);
                    })();
                </script>
            </p>
            <p class="xs0">
                GMT+8, 2018-12-12 10:42<span id="debuginfo">
</span>
            </p>
        </div>
        <div id="frt"style="float: left">
            <p>Powered by <strong><a href="#">Discuz!</a></strong> <em>X3.4</em></p>
            <p class="xs0">&copy; 2001-2018 <a href="#">Comsenz Inc.</a></p>
        </div>

        <div id="scrolltop">
            <span hidefocus="true"><a title="返回顶部" onclick="window.scrollTo('0','0')" class="scrolltopa" ><b>返回顶部</b></a></span>
        </div>

</body>
</html>

